const vm = new Vue({
    el: '#app',
    data: {
        loginForm: {
            use: '',
            pwd: ''
        },
        rulesLogin: {
            use: [
                { required: true, message: '请输入账号', trigger: 'blur' },
            ],
            pwd: [
                { required: true, message: '请选择密码', trigger: 'change' }
            ]
        }
    },
    methods: {
        submitLoginForm(formName) {
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    location.href = '/';
                } else {
                    console.log('没有提交成功');
                    return false;
                }
            });
        }
    }
});